// npm先下载express才可以用
// npm先下载axios才可以用
// npm init -y
// npm install express 
// npm i axios
const express = require('express')
const axios = require('axios');
const app = express()

const port = 4000
app.use(express.static('pulic'))

app.get('/', (req, res) => {
    res.send('Hello World!')
  })
app.get('/get/data', async (req, res) => {
    // 请求卖座的接口即可
    let url = `https://m.maizuo.com/gateway?cityId=440100&pageNum=1&pageSize=10&type=2&k=1460226`;
    let response = await axios({
        url,
        headers: {
            'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.2.1","e":"16684773955136411518828545","bc":"440100"}',
            'X-Host': 'mall.film-ticket.film.list',
        }
    });
    res.json(response.data)
})
app.listen(port, () => {  
    console.log(`Example app listening on port ${port}`)
})